# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Contributor: mathieui <mathieui@mathieui.net>
# Contributor: jiribb <jiribb@gmail.com>

pkgname=ldns
pkgver=1.7.1
pkgrel=2
pkgdesc='Fast DNS library supporting recent RFCs'
url='https://www.nlnetlabs.nl/projects/ldns/'
license=('custom:BSD')
arch=('x86_64')
depends=('openssl' 'dnssec-anchors')
optdepends=('libpcap: ldns-dpa tool')
makedepends=('libpcap')
source=("https://www.nlnetlabs.nl/downloads/${pkgname}/${pkgname}-${pkgver}.tar.gz")
sha256sums=('8ac84c16bdca60e710eea75782356f3ac3b55680d40e1530d7cea474ac208229')

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--disable-rpath \
		--with-drill \
		--with-examples \
		--with-trust-anchor=/etc/trusted-key.key \

	make
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"
	make DESTDIR="${pkgdir}" install
	install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
